1 Description of Data

  • Salmon stock-recruitment data for populations in Alaska, BC, and Puget Sound were compiled from various sources by C. Cunningham (AFSC).
  • Salmon SR data from Washington, Oregon, and California were compiled by J. Gosselin and B. Burke (NWFSC)
  • These two datasets were combined in late November, 2018.
  • Update: Chinook salmon data have multiple runs with the same stock identifier. Scripts must contain code to append run to stock if present.

2 Structure of Data

Data is now stored in object called AK-WCoast-Salmon-SR.csv

dat <- read.csv("AK-WCoast-Salmon-SR.csv", header=TRUE)

What is the structure of this data frame?

kable(head(dat), align="crr") %>% #, digits=c(3,1,1)) %>%
  kable_styling(bootstrap_options = c("striped", "hover"))
stock.id species run stock region sub.region broodYr spawn rec large.region
NA Sockeye NA Bear AK Peninsula AK Peninsula 1980 238038 545500 BS
NA Sockeye NA Bear AK Peninsula AK Peninsula 1981 214728 318386 BS
NA Sockeye NA Bear AK Peninsula AK Peninsula 1982 104503 280870 BS
NA Sockeye NA Bear AK Peninsula AK Peninsula 1983 172143 319246 BS
NA Sockeye NA Bear AK Peninsula AK Peninsula 1984 108151 503626 BS
NA Sockeye NA Bear AK Peninsula AK Peninsula 1985 170739 939836 BS

Recorded brood years run from 1922 to 2016.

3 Preliminary Calculations

First we need to add recruits-per-spawner and log recruits-per-spawner

dat$rps <- dat$rec/dat$spawn
dat$ln.rps <- log(dat$rps)
kable(head(dat), align="crr") %>% #, digits=c(3,1,1)) %>%
  kable_styling(bootstrap_options = c("striped", "hover"))
stock.id species run stock region sub.region broodYr spawn rec large.region rps ln.rps
NA Sockeye NA Bear AK Peninsula AK Peninsula 1980 238038 545500 BS 2.291651 0.8292725
NA Sockeye NA Bear AK Peninsula AK Peninsula 1981 214728 318386 BS 1.482741 0.3938924
NA Sockeye NA Bear AK Peninsula AK Peninsula 1982 104503 280870 BS 2.687674 0.9886761
NA Sockeye NA Bear AK Peninsula AK Peninsula 1983 172143 319246 BS 1.854540 0.6176364
NA Sockeye NA Bear AK Peninsula AK Peninsula 1984 108151 503626 BS 4.656693 1.5383055
NA Sockeye NA Bear AK Peninsula AK Peninsula 1985 170739 939836 BS 5.504519 1.7055693

4 Data Quality Control

We also need to screen out non-sensical values reported in the data, specifically:

  • ln.rps is infinite, i.e. spawners were reported as zero
  • ln.rps is NA, i.e. either rec or spawn was blank
  • We also filter filter brood years:

  • broodYr > 1950 as this is the start of the NPGO index.
  • broodYr <= 2010 to ensure all complete return of age classes for all species.

dat.2 <- dat %>% filter(!is.infinite(ln.rps), !is.na(ln.rps), broodYr>=1950, broodYr<=2010)

So, the total number of observations is: 8549.

4.1 Deal with multiple runs of Chinook to same river.

I noticed that on the West Coast there were multiple Chinook salmon run identifiers for the same stock by broodYr combination. We need to identify these instances and update the stock name so it is treated separately in subsequent data exploration and STAN stock-recruitment models.

As it turns out there are 2583 observations (years) our of 8549 for which a run is identified.

5 Explore Data

5.1 Number of stocks by species and region

sum.stocks_species.region <- dat.2 %>% group_by(species, region) %>% summarize('n.stocks'=length(unique(stock)))
# kable(sum.stocks_species.region, align="crr") %>% #, digits=c(3,1,1)) %>%
  # kable_styling(bootstrap_options = c("striped", "hover"))

g <- ggplot(sum.stocks_species.region, aes(x=region, y=n.stocks, fill=species)) +
       theme_linedraw() +
       scale_fill_colorblind() +
       geom_bar(stat='identity', position='stack') +
       theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
       ylab('Number of Stocks')
plot(g)

5.2 Number of Years of Data by species and region

sum.years_species.region <- dat.2 %>% group_by(species, region) %>% summarize('n.years'=n())
# kable(sum.years_species.region, align="crr") %>% #, digits=c(3,1,1)) %>%
  # kable_styling(bootstrap_options = c("striped", "hover"))

g <- ggplot(sum.years_species.region, aes(x=region, y=n.years, fill=species)) +
       theme_linedraw() +
       scale_fill_colorblind() +
       geom_bar(stat='identity', position='stack') +
       theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
       ylab('Number of Years with Data')
plot(g)

5.3 Number of Regions is now: 25.

6 Plot Stock-Recruitment Data

6.1 Species Combined

6.1.1 Facet: species, Color: region

6.1.2 Facet: region, Color: species

6.2 Chinook

6.2.1 Data

6.2.2 Data + Smooth

## `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'

6.3 Sockeye

6.3.1 Data

6.3.2 Data + Smooth

## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

6.4 Pink

6.4.1 Data

6.4.2 Data + Smooth

## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

6.5 Chum

6.5.1 Data

6.5.2 Data + Smooth

## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

6.6 Coho

6.6.1 Data

6.6.2 Data + Smooth

## `geom_smooth()` using method = 'loess' and formula 'y ~ x'